<!DOCTYPE html>
<html>
<head>
  <title>系统初始化</title>
</head>
<style type="text/css">
  .flex{
    height: 100vh;
    display: flex;
    width: 100vw;
    flex-direction: column;
  }
  body{
    margin: 0;
    padding: 0;
    background: #409EFF;
  }
 .column{
    flex-direction:column;
  }
 .row{
    flex-direction:row;
  }
  .center{
    justify-content: center;
    align-items: center;
  }
  .flex .item{
    flex:1;
  }
  label{
    padding-left: 5px;
    padding-right: 5px;
  }
  .li{
    justify-content: center;
    display: flex;
    height: auto;
    /*background: #FFFFFF;*/
    padding-top: 2px;
    padding-bottom: 2px;
    width: 100%;
  }
  .ul .tip{
    font-size:0.7em;
    background: rgba(225,225,225,1);
  }
  .ul{
    box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
    position: relative;
    height: auto;
    border-radius: 10px;
    padding: 20px;
    width: 400px;
    box-sizing: border-box;
    background: #E4E7ED;
  }
  .li .item:first-child{
    text-align: right;
  }
   .li .item:nth-child(2){
    text-align: left;
  }
  .ul .title{
    top: 0;
    /*position: absolute;*/
    background: #606266;color: #fff
  }
  div{
    line-height: 2em;
    height: 2em;
  }
  input{
    line-height: 1.7em;
    height: 1.7em;
  }
  button{
    width: 25%;
    font-size: 1em;
    /*padding: 5px;*/
    line-height: 3.2em;
    height: 3.5em;
    background: #FFFFFF;
    border-radius: 5px;
  }
  button:hover{
    /*background: #409EFF;*/
    opacity: 0.5;
  }

  .loading{
    border-top:20px solid #387cff;
    border-bottom:20px solid #387cff; 
    border-left:20px solid #387cff; 
    border-right:20px solid rgba(255,255,255,1);
    border-radius: 50%; 
    animation: loading 2s infinite;
  }
  @keyframes loading{
   0%{
     transform: rotate(0deg);
     }
    100%{
     transform: rotate(360deg);
     }
 }
</style>
<script type="text/javascript">

</script>
<body>

<div class="flex column center" id="content">
    <div  id="confirm" class="ul flex column center"  style="background: #fff;display: none">
      <h3>提示</h3>
      <div id="tishi" style="width: 100%;height:100px;" class=" column center">
       本次操作将会重新配置数据库地址/端口/库名/前缀名/用户名/密码相关信息。配置后立即生效。
      </div>
      <div class="li" style="justify-content: flex-end;flex-wrap: wrap;">
        <button onclick="show(1)">确认</button>
        <button onclick="show(0)">取消</button>
      </div>
    </div>

  <div id="form" class="ul flex column center">
      <div class="li title"  onclick="masking.open()">
        数据库配置设置
      </div>
      <div class="li" id='lils' style="justify-content: space-between;flex-wrap: wrap;">
        {foreach $data['model'] as $key=>$vo } 
            <button style="flex: 1" onclick="tapConfirm('{$key}','{$vo['template']}')">{$vo['title']}</button>
        {/foreach}
      </div>

       <div class="li tip" >
        提示：创建完项目后，请修改public/install.php文件名后缀为install.php.bak,以防被人恶意修改。下次使用时候在手动修改回来即可。
      </div>
  </div>
</div>
</body>
<script type="text/javascript">

  // var btls=document.getElementById('lils');
  // btls.innerHTML=JSON.parse(data);
      // btls.innerHTML=data;
       // data;
 function tapConfirm(model,temp) {

  var title ='';
  var url="{$data['root']}/index/"+temp+'?model=';
  switch(model){
    case 'system':
    title='本次操作仅删除框架本身的所有数据和数据表，删除后无法恢复,如果有重要数据请备份后在操作。';
    url+=model;
    break;
    default:
    url+=model;
    break;
  }
window.open(url);
}


</script>
</html>